package com.app.infra.configuration;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@ConfigurationProperties(prefix = "app")
@Component
@Getter
@Setter
@Validated
public class AppProperties {
    /**
     * 上传文件存储目录路径
     */
    private String fileUploadPath;
    
    /**
     * 接口白名单
     */
    private List<String> whiteList = new ArrayList<>();
    
    private IccProperties icc;
    
    @Getter
    @Setter
    public static class IccProperties {
        private String host;
        
        private String clientId;
        
        private String clientSecret;
        
        private IccSubscriptionProperties subscription;
    }
    
    @Getter
    @Setter
    public static class IccSubscriptionProperties {
        private String ip;
        
        private String port;
        
        private String url;
    }
}
